package com.topchain.entity;


import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * (Licence)表实体类
 *
 * @author sunhg
 * @since 2024-11-13 18:30:26
 */
@SuppressWarnings("serial")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_licence")
public class Licence implements Serializable {
    private static final long serialVersionUID = -75650619099874175L;
    
    @TableId
    @ApiModelProperty("id")
    private Integer id;

    @ApiModelProperty("用户名称")
    private String user;
    
    @ApiModelProperty("使用者服务器的IP地址")
    private String allowIp;
    
    @ApiModelProperty("mac地址")
    private String mac;
    
    @ApiModelProperty("有效期开始时间")
    private String notBeforeTime;
    
    @ApiModelProperty("有效期结束时间")
    private String notAfterTime;
    
    @ApiModelProperty("关联用户证书(此licence是用哪个用户对应的私钥生成的)")
    private Integer userCertId;
    
    //@TableField(exist = false)
    //@ApiModelProperty("关联用户证书")
    //private String userCertName;
    
    @ApiModelProperty("licence内容")
    private String licence;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    
    @ApiModelProperty(value = "licence版本(每续期一次,版本加1)")
    private Integer version;
    
    @ApiModelProperty(value = "licence的摘要值(SM3)")
    private String digest;
}
